{extend name="index@common/base"/} 
{block name="style"}
{/block} {block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[1]['title']}</p>
			{/if}
		</div>
	</div>
	<div class="park-content">
		<div class="content-title">
			<div class="title col-8">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form" action="{:url('plan/company/search')}" onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<input class="search-input" name="keyword" type="text" placeholder="项目名称" id="keyword"  autocomplete="off">
					<select name="unitId">
						<option value="">单位</option>
						{volist name="enterpriseList" id="vo" }
						<option value="{$key}">{$vo}</option>
						{/volist}
					</select>
					<select name="typeId">
						<option value="">灾情类型</option>
						{volist name="type" id="vo" key="k"}
						<option value="{$k}">{$vo}</option>
						{/volist}
					</select>
				</form>	
			</div>
			<div class="tool col-2">
				<button id="add" data-url="{:url('plan/company/add')}"><i class="fa fa-plus"></i></button>
				<button id="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<div class="layui-content" lay-accordion id="company" data-url="{:url('plan/company/index')}">
		</div>
	</div>
</div>
{/block}
{block name="script"}

<script type="text/javascript" src="__JS__/plan/company.js"></script>

<script id="tableTemplate" type="text/html">
	
        {{# for(var i = 0;i < d.length; i++){ }}
		<div class="maintab">
        <table class="plan-table">
           	<thead>
			<tr>
                <th>标题</th>
                <th>简介</th>
				<th>灾情分类</th>
				<th>所属单位</th>
				<th>危险目标及特征</th>
				<th>应急组织机构及职责</th>
				<th>状态</th>
				<th>审核</th>
                <th >
					
				</th>
            </tr>
			</thead>
			<colgroup>
                 <col width="10%">
                 <col width="10%">
				 <col width="10%">
				 <col width="10%">
				 <col width="10%">
				 <col width="15%">
				 <col width="10%">
 				 <col width="10%">
            </colgroup>
			<tbody>
  				<tr>
                 	<th class="content">
						{{# if(d[i].pathInfo){ }}
							<a  href="__PUBLIC__{{d[i].pathInfo}}" style="color:#1e9fff">{{d[i].title}}</a>
						{{# }else{ }}
							{{d[i].title}} <span style="color: red">(未上传)</span>
						{{# } }}
					</th>
                 	<th class="content"><p>{{d[i].desc}}</p></th>
					<th class="content">{{d[i].typeId}}</th>
					<th class="content">{{d[i].enterprise.shortname}}</th>
					<th class="content">{{d[i].targetFeatures}}</th>
					<th class="content">{{d[i].organization}}</th>
					<th class="content">
						{{# if (d[i].isValid == 1){ }}
							<p>有效性: <span class="layui-badge-circle layui-bg-green"><i class="fa fa-check"></i></span></p>
						{{# }else{ }}
						<p>有效性: <span class="layui-badge-circle layui-bg-red"><i class="fa fa-close"></i></span></p>
						{{# } }}
					</th>
					<th class="content">
						<div>
							{{# if (d[i].checkStatus == 1){ }}
								<p class="badge-audit-state pending-approval"></p>
							{{# } }}
							{{# if (d[i].checkStatus == 2){ }}
								<p class="badge-audit-state under-review"></p>
							{{# } }}
							{{# if (d[i].checkStatus == 3){ }}
								<p class="badge-audit-state check-success"></p>
							{{# } }}
						</div>
					</th>
					<th style="text-align:center">
						<a class="layui-btn btn-config add-script"  data-url="{:url('plan/company/scriptAdd')}?planId={{d[i].id}}"><i class="fa fa-plus"></i></a>
						<a class="layui-btn btn-edit edit-plan"  data-url="{:url('plan/company/edit')}?planId={{d[i].id}}"><i class="fa fa-pencil"></i></a>
  						<a class="layui-btn btn-del del-plan" data-url="{:url('plan/company/del')}?planId={{d[i].id}}"><i class="fa fa-trash"></i></a>
						{{# if(d[i].checkStatus == 1){ }}
							<a class="layui-btn btn-audit audit-plan"  data-url="{:url('plan/company/audit')}" data-id="{{d[i].id}}"><i class="fa fa-file-text"></i></a>
						{{# } }}  
					</th>
            	</tr>
			</tbody>
        </table>
        {{# if(d[i].scripts != null){ }}
            <div class="maintab">
                <table class="script-table detail-table">
                    <colgroup>
						<col width="5%">
                        <col width="45%">
                 		<col width="10%">
				 		<col width="10%">
						<col width="10%">
                    </colgroup>
                    <tbody>
                        {{# for(var j = 0;j < d[i].scripts.length; j++){ }}
                        <tr>
							<td>
								<p>{{d[i].scripts[j].stepIndex}}</p>
							</td>
                            <td>
                                <p><b>行动内容: </b>{{d[i].scripts[j].stepDesc}}</p>
                            </td>
                            <td>
                                <p><b>执行项目: </b>{{d[i].scripts[j].actionId}}</p>
                            </td>
                            <td>
                               <p>
								<b>负责人: </b>
									{{# if (d[i].scripts[j].staff != null){ }}
										{{d[i].scripts[j].staff.staffName}}
									{{# } }}
							   </p>
                            </td>
							<td>
								<p>
								<b>电话: </b>
									{{# if (d[i].scripts[j].staff != null){ }}
										{{d[i].scripts[j].staff.mobile}}
									{{# } }}
								</p>
							</td>
                            <td style="text-align:center;">
								<a class="layui-btn btn-edit edit-script" id="edit_{{d[i].scripts[j].id}}" data-url="{:url('plan/company/scriptedit')}?scriptId={{d[i].scripts[j].id}}&planId={{d[i].id}}"><i class="fa fa-pencil"></i></a>
  								<a class="layui-btn btn-del del-script"   id="del_{{d[i].scripts[j].id}}" data-url="{:url('plan/company/scriptdel')}?scriptId={{d[i].scripts[j].id}}"><i class="fa fa-trash"></i></a>
                            </td>
                        </tr>
                         {{# } }}
                    </tbody>
                </table>
            </div>
          {{# } }}
		</div>
      {{# } }}
    </script>
{/block}

